package com.jeff.android.lab.database.greendao;

import com.jeff.android.lab.BaseFragment;
import com.jeff.android.lab.R;
import com.jeff.android.lab.database.greendao.model.Work;
import com.jeff.utils.ToastUtil;

import butterknife.OnClick;

public class GreenDaoFragment extends BaseFragment {
    @Override
    protected int getRootLayout() {
        return R.layout.db_fragment_ormlite;
    }

    @OnClick(R.id.bt_create)
    public void create() {
        Work work = new Work(8000.00);
        GDDataManager.instance(mContext).insert(work);
    }

    @OnClick(R.id.bt_query)
    public void query() {
        Work work = GDDataManager.instance(mContext).query();
        if (work != null) {
            ToastUtil.show(mContext, work.toString());
        }

    }

}
